package com.chenjj.bankm.example.consumer.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

//Feign会根据name去eureka注册中心查找可用的服务，并注册成一个bean
@FeignClient(name = "provider-example")
public interface ProviderService {

    //通过RequestMapping指向provider的接口
    @RequestMapping(value = "/getUser",method = RequestMethod.GET)
    Map<String,Object> getUser(@RequestParam("id") Integer id);
}
